<?php

return [
	'Read' => function() {
	   $n = new \Yls\Core\Criteria([]);
	   echo $n;die;
	    $db = Yls::Db()->Select('id, name');
	    $db->From('User');
	    $result = $db->Read();
	    var_dump($result);die;
    	$data = Yls::Db()->Fetch(new \Yls\Core\Criteria([
	        'bind' => [
	            'id',
	            'name' => 'User.name',
	            'level' => '~Vip.level'
	        ],
	        'select' => '*', // string|function
	        'from' => '', // string|function
	        'partition' => '', // string|function
	        'join' => [
	            ['LEFT', '~Message', 'on', '~Message.userId = User.id'],
	            ['LEFT', '~Vip', 'ON', '~Vip.userId = User.id']
	        ],
	        'group' => Yls::Instance()->Param('group') ? 'User.gender' : null,
	        'having' => Yls::Instance()->Param('group') ? 'Having (n > 1)' : null,
	        'order' => ['User.id DESC'],
	        'limit' => [10, 20]
        ]));
    	
    	$db = Yls::Db()->Select('id, name');
    	
    	print_r($data);die;
	}
];